package com.chushouya.common.constant;

import com.general.framework.core.enums.IEnum;
import com.general.framework.core.lang.Strings;

import java.util.Objects;

public enum ShowFlagEnum implements IEnum<Integer> {

    hide( 0,  "隐藏"),
    show(1,  "显示");

    private Integer value;

    private String desc;

    ShowFlagEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    @Override
    public Integer value() {
        return this.value;
    }

    @Override
    public String named() {
        return this.desc;
    }

    public static String getDesc(Integer value) {
        for (ShowFlagEnum thisEnum : ShowFlagEnum.values()) {
            if (Objects.equals(thisEnum.value, value)) {
                return thisEnum.desc;
            }
        }
        return Strings.EMPTY;
    }

}
